import { PromiseData } from '@/@types/request'
import request, { OperateData } from '@/utils/request'
import { ReviewInfo, TableParams } from './data'
import { IPressure } from '@/@types/common'

// 查询当前信息
export const getReviewInfo = (data: TableParams): Promise<PromiseData<ReviewInfo>> =>
  request.post('/dataReport/getDataTaskDetail', data)

interface AgreeParams {
  applyStatus: string // 1同意 2拒绝
  ids?: number[] //  变量 事件 id
  dataId: number
  updateId: number
  backReason?: string
  injuryIds?: number[]
}
// 审核接口
export const updatePassAndNoPass = (data: AgreeParams): Promise<PromiseData<OperateData>> =>
  request.post('/dataEscalationExamineApplyUpdate/applyPassAndNoPass', data)

// 获取事件内容
export const getInjuryInformation = (data: { dataId: number; updateId?: number }): Promise<PromiseData<IPressure[]>> =>
  request.post('/dataReport/getInjuryInformation', data)
